<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.smallDiv{
				width: 30px;
				height: 30px;
				display: inline-block;
			}
		</style>
	</head>
	<body >
		
		<script type="text/javascript">
			
			// const 常量
			const N = 20;
			for(var i=0;i<N;i++)
			{
				document.write("<div>");
				for(var j=0;j<N;j++)
				{
					var r = Math.floor(Math.random()*256);
					var g = Math.floor(Math.random()*256);
					var b = Math.floor(Math.random()*256);
					var color = "#"+r.toString(16)+g.toString(16)+b.toString(16);
					
					document.write("<div class='smallDiv' style='background-color: "+color+";'></div>");					
				}
				document.write("</div>");
			}
			
		</script>
	</body>
</html>
